<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: iint</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: iint</td>
      <td class="subheader-left"><a href="matlab:open iint">View code for iint</a></td>
    </tr>
  </table>
<h1>iint</h1><p><span class="helptopic">Convert image to integer class</span></p><p>
<strong>out</strong> = <span style="color:red">iint</span>(<strong>im</strong>) is an image with unsigned 8-bit integer elements in the
range 0 to 255 corresponding to the elements of the image <strong>im</strong>.

</p>
<p>
<strong>out</strong> = <span style="color:red">iint</span>(<strong>im</strong>, <strong>class</strong>) as above but the output pixels belong to the
integer class <strong>class</strong>.

</p>
<h2>Examples</h2>
<p>
Convert double precision image to 8-bit unsigned integer

</p>
<pre style="width: 90%%;" class="examples">
im&nbsp;=&nbsp;rand(50,&nbsp;50);
out&nbsp;=&nbsp;iint(im);
</pre>
<p>
Convert double precision image to 16-bit unsigned integer

</p>
<pre style="width: 90%%;" class="examples">
im&nbsp;=&nbsp;rand(50,&nbsp;50);
out&nbsp;=&nbsp;iint(im,&nbsp;'uint16');
</pre>
<p>
Convert 8-bit unsigned integer image to 16-bit unsigned integer

</p>
<pre style="width: 90%%;" class="examples">
im&nbsp;=&nbsp;randi(255,&nbsp;50,&nbsp;50,&nbsp;'uint8');
out&nbsp;=&nbsp;iint(im,&nbsp;'uint16');
</pre>
<h2>Notes</h2>
<ul>
  <li>Works for an image with arbitrary number of dimensions, eg. a color
image or image sequence.</li>
  <li>If the input image is floating point (single or double) the pixel values
are scaled from an input range of [0,1] to a range spanning zero to the
maximum positive value of the output integer class.</li>
  <li>If the input image is an integer class then the pixels are cast to
change type but not their value.</li>
</ul>
<h2>See also</h2>
<p>
<a href="matlab:doc idouble">idouble</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2012 Peter Corke.</p>
</body></html>